-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: O3-310: Add an application-writable config.json file in frontends/ (attempt #2) #865
base: main
Are you sure you want to change the base?
Conversation
Size Change: -41.2 kB (-1%) Total Size: 2.72 MB
ℹ️ View Unchanged
|
This actually depends on openmrs/openmrs-module-webservices.rest#595, which is the active version of that PR. |
useMemo(async () => { | ||
const dependencies = await initInstalledBackendModules(); | ||
setBackendDependencies(dependencies); | ||
}, []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use a useEffect
instead?
@@ -155,3 +156,21 @@ export async function checkModules(): Promise<Array<ResolvedDependenciesModule>> | |||
export function hasInvalidDependencies(frontendModules: Array<ResolvedDependenciesModule>) { | |||
return frontendModules.some((m) => m.dependencies.some((n) => n.type !== 'okay')); | |||
} | |||
|
|||
export function useBackendDependencyCheck(moduleName: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rename the hook to something like: useBackendModuleExists(moduleName: string)
. What do you think of adding an optional parameter that validates the module versions:
export function useBackendModuleExists(moduleName: string, moduleVersion?: string) {}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with the rename, but don't complicate code for no reason. You can add that parameter when you need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think we are going to need a version check for this to function properly. Regardless of which module the backend code for this goes into, it's only going to be available from the next version on, so it would be nice if isSpaModulePresent
was actually based on not just the presence of the module, but the presence of at least a minimal version...
8f994a6
to
9cee659
Compare
Reverts #864
This restores @jnsereko 's #629.
Depends on openmrs/openmrs-module-spa#57 .
Sorry about the hasty work. Let's get this stuff in though.